]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: Allow dropping icons on windows
authorAdel Gadllah <adel.gadllah@gmail.com>
Tue, 7 Jun 2011 21:15:33 +0000 (23:15 +0200)
committerAdel Gadllah <adel.gadllah@gmail.com>
Mon, 13 Jun 2011 20:30:52 +0000 (22:30 +0200)
Currently the user has to find an empty spot in the workspace
to be able to launcha new instance of an app using dnd.

This is unnecessary hard, so just allow dropping on windows too.

https://bugzilla.gnome.org/show_bug.cgi?id=652079

js/ui/workspace.js
js/ui/workspacesView.js

index c734f6f1178592b4ae75c622caec76683bab05a2..f1527f43693e6082a3890773b78bcab74df84f11 100644 (file)
@@ -308,6 +308,21 @@ WindowClone.prototype = {
         this.emit('drag-begin');
     },
 
+    _getWorkspaceActor : function() {
+        let index = this.metaWindow.get_workspace().index();
+        return Main.overview.workspaces.getWorkspaceByIndex(index);
+    },
+
+    handleDragOver : function(source, actor, x, y, time) {
+        let workspace = this._getWorkspaceActor();
+        return workspace.handleDragOver(source, actor, x, y, time);
+    },
+
+    acceptDrop : function(source, actor, x, y, time) {
+        let workspace = this._getWorkspaceActor();
+        workspace.acceptDrop(source, actor, x, y, time);
+    },
+
     _onDragCancelled : function (draggable, time) {
         this.emit('drag-cancelled');
     },
index 573a1b8948c11285058957dc88c5cd69257d06bc..9c5b595519f6e12c9745c7aade7a2272fbfd1781 100644 (file)
@@ -149,6 +149,10 @@ WorkspacesView.prototype = {
         return this._workspaces[active];
     },
 
+    getWorkspaceByIndex: function(index) {
+        return this._workspaces[index];
+    },
+
     hide: function() {
         let activeWorkspaceIndex = global.screen.get_active_workspace_index();
         let activeWorkspace = this._workspaces[activeWorkspaceIndex];